<script type="text/javascript">
	addTab("<?php echo Core_Util::escapeForJs2($this->contest->getTitle())?>",
        '<?php echo $this->urlKeepIdPage(array('controller' => 'entry','action' => 'list', 'id_contest' => $this->entry->id_contest));?>')
</script>

<form class="sm_form standard detail" style="width: 100%;">
	<dl class="zend_form">
        <div style="text-align: center;">
           	<?php if(APP_INSTANCE == APP_INSTANCE_IMAGE):?>
            <img id="submission_image" class="submission_image" 
                        src="<?php echo $this->entry->getSubmissionImageUrl(); ?>" />
			<?php else: ?>
				<?php echo $this->entry->getEmbeddedCode() ?>
			<?php endif;?>
        </div>
		<dt><label><?php echo $this->translate('LABEL_TITLE')?></label></dt>
		<dd>
			<?php echo $this->escape($this->entry->title);?>
		</dd>
		<dt><label><?php echo $this->translate('LABEL_DESCRIPTION')?></label></dt>
		<dd>
			<?php if( !empty($this->entry->description) ):?>
			<?php echo nl2br($this->escape($this->entry->description));?>
			<?php else:?>
			n/a
			<?php endif;?>
		</dd>
		<?php foreach($this->candidateInfo as $key => $value): ?>
			<dt><label><?php echo $this->translate($key)?></label></dt>
			<dd>
				<?php 
					if(trim($value)=='' || $value == -1):
						echo "n/a";
					else:
						echo $this->escape($value);
					endif;
				?>
			</dd>
		<?php endforeach;?>
			<dt id="submitButtons-label"></dt>
			<dd>
                <?php if ($this->entry->status != Core_Model_IEntry::STATUS_APPROVED):?>
                    <button id="approve" class="greenbutton" 
                            onclick="approve_entry('<?php echo $this->entry->id?>')"
                            type="button" name="approve">
                            Approve
                    </button>
                <?php endif;?>
                <?php if ($this->entry->status != Core_Model_IEntry::STATUS_REJECT):?>
                    <button id="reject" class="greenbutton" 
                            onclick="reject_entry('<?php echo $this->entry->id?>')"
                            type="button" name="reject">
                            Reject
                    </button>
                <?php endif;?>
				<button id="back" class="graybutton" 
						onclick="window.isSubmitting = true;location.href='<?php echo $this->back_url . (!empty($_GET) ? ('?' . http_build_query($_GET)) :  '') ?>';"
						type="button" name="back">
						Back
				</button>
			</dd>
	</dl>
</form>
<div class="clear-both">&nbsp;</div>

<script type="text/javascript">
    function reject_entry(id_entry)
    {
        var ok = confirm('<?php echo $this->translate('MSG_CONFIRM_REJECT')?>');
        if (ok) {
            location.href="<?php echo $this->baseUrl('/contest/entry/reject/id_entry/');?>" + id_entry + '?' + '<?php echo http_build_query($_GET) ?>';
        }
        return false;
    }
    
    function approve_entry(id_entry)
    {
        location.href="<?php echo $this->baseUrl('/contest/entry/approve/id_entry/');?>" + id_entry + '?' + '<?php echo http_build_query($_GET) ?>';
    }
    $(document).ready(function(){
        canvasScrollTo(0,0);
    });
</script>